#include "comm.h"

int main() {
    int fd = open(FILE_NAME, O_WRONLY);
    if(fd < 0) {
        perror("open error");
        exit(1);
    }
    char message[256];
    while(true) {
        message[0]= '\0';
        printf("please enter: ");
        fflush(stdout);
        ssize_t s = read(0, message, sizeof(message) - 1);
        if(s > 0) {
            message[s - 1] = '\0';
            write(fd, message, strlen(message));
        }
    }
    close(fd);
    return 0;
}
